package com.api.controller;



import com.api.utils.MyExceptionUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestMain {

    @RequestMapping(value = "deleteByIds")
    public void delete() {
        int[] numList = {1, 5, 2, 7, 3, 2};
        ListTest(numList);
    }

    public static String myException() {
        int i = 0;
        int a = 10;
        if (i > a) {
            System.out.println("测试！！！");
        } else {
            throw MyExceptionUtil.mxe("出错了，比他小啊！！");
        }
        return "没有进行拦截，失败了";
    }

    public static void ListTest(int[] numList)  {
        int[] num = new int[numList.length - 1];
        for (int i = 0; i < numList.length; i++) {
            num[i] = numList[i];
        }
    }

    public static void TestReturn(String msg){
        myException();
        System.out.println(msg);
    }

    public static void main(String[] args) {
        TestReturn("你好");
    }

}
